#include <stdio.h>
int main()
{
    double eps, sum = 0;
    int i = 1;
    scanf("%lf", &eps);
    while (1.0 / (3 * i - 2) > eps)
    {
        sum += ((i % 2 == 1) ? 1 : -1) * 1.0 / (3 * i - 2);
        // printf("%d, %f, %f\n", i, sum, ( (i % 2 == 1) ? 1 : -1) * 1.0 / (3 * i - 2));
        i++;
    }
    sum += ((i % 2 == 1) ? 1 : -1) * 1.0 / (3 * i - 2);
    printf("sum = %.6f", sum);
    return 0;
}